import {
    reqGetBaseCategoryList
} from "@/api/home";

// vuex模块
export default {
    namespaced: true,
    state: {
        // 首页三级分类列表
        baseCategoryList: [],
    },
    actions: {
        async getBaseCategoryList({
            commit
        }) {
            const baseCategoryList = await reqGetBaseCategoryList();
            commit("GET_BASE_CATEGORY_LIST", baseCategoryList);
        },
    },
    mutations: {
        GET_BASE_CATEGORY_LIST(state, baseCategoryList) {
            state.baseCategoryList = baseCategoryList;
        },
    },
};